package com.ai.study;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.context.WebServerApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;

@Slf4j
@SpringBootApplication
public class SpringAlibabaAiStudyApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext =
                SpringApplication.run(SpringAlibabaAiStudyApplication.class, args);
        WebServerApplicationContext webServerApplicationContext = (WebServerApplicationContext) applicationContext;
        String applicationName = applicationContext.getApplicationName();
        int port = webServerApplicationContext.getWebServer().getPort();

        log.info("SpringAI Alibaba项目启动成功..." + "http://localhost:" + port + applicationName);
    }

}
